//
//  UIViewController+Utils.h
//  JiaBoWang
//
//  Created by Huazhixi on 2017/4/13.
//  Copyright © 2017年 HandTV. All rights reserved.
//

#import <UIKit/UIKit.h>

#define CurrentViewController [UIViewController currentViewController]

@interface UIViewController (Utils)

@property(nonatomic,strong,readonly)UINavigationController *myNavigationController;

+ (UIViewController *) currentViewController;

/// 普通push 同 [self.navigationConrtroller pushViewController:animated];
- (void)ys_pushViewController:(UIViewController *)viewController animated:(BOOL)animated;

/// 替换当前viewController
/// @param viewController 替换后的viewController
- (void)ys_replaceViewController:(UIViewController *)viewController;

/// 导航到viewController 如果堆栈中存在相同类型的viewController 则替换并pop, 不存在则push
/// @param viewController 目标viewController
/// @param animated 是否动画
- (void)ys_navigateViewController:(UIViewController *)viewController animated:(BOOL)animated;
@end
